import QtQuick 2.0
import QtGraphicalEffects 1.0

Item {
    width: time.width
    height: time.height + day.height

    function leadingZero(n) {
        if (n < 10) return '0' + n;
        else return n;
    }

    function timeChanged() {
        var date = new Date;
        time.text = leadingZero(date.getHours()) + ':'
                + leadingZero(date.getMinutes())
        day.text = date.getDate() + '.' + (date.getMonth() + 1) + '.' + date.getFullYear()
    }

    Timer {
        interval: 1000
        running: true
        repeat: true
        onTriggered: timeChanged();
    }

    Text {
        id: time
        color: "white"
        font.bold: true
        text: ""
        font.pointSize: 56
    }
    Text {
        id: day
        color: "white"
        text: "Sunday, Feb 3"
        font.pointSize: 24
        anchors.top: time.bottom
        anchors.horizontalCenter: parent.horizontalCenter
    }

}
